package com.weigang.webservice.controller;



/**
 * @author whj
 * @version 1.0
 * @date 2022/5/17 15:13
 * @describe 查重响应
 */
public class CheckResponse {
    //200-存在、500-不存在
    private String result;
    //查询存在返回：已存在该低值易耗、备品备件、包装材料，请重新输入
    private String message;

    public CheckResponse() {
    }

    public CheckResponse(String message) {
        this.message = message;
    }

    public CheckResponse fail(String message) {
        this.result = "500";
        this.message = message;
        return this;
    }

    public CheckResponse ok(String message) {
        this.result = "200";
        this.message = message;
        return this;
    }

    public static CheckResponse error(String message) {
        return new CheckResponse().fail(message);
    }


    public static CheckResponse success(String message) {
        return new CheckResponse().ok(message);
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
